<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            color: aqua
        }
    </style>
</head>

<body>
    <div id="d1">这是一个div</div>
    <div id="d2">div222</div>
    <p id="pp1">p标签</p>
    <span id="span1" class="box">span标签</span>
    <script>
        let a = document.getElementById("d1")
        console.log(a)
        b = document.getElementsByTagName("p")
        console.log(b)
        c = document.getElementsByClassName("box")
        console.log(c)
        let d = document.createElement("h1")
        d.innerText = "111"
        d1.appendChild(d)
    </script>
</body>

</html>